package com.king.base;

import com.google.common.base.Objects;

//=比较的是栈区，equals比较的是堆区的, Objects.equal()比较的堆栈区
public class ObjectsDemo {
    public static void main(String[] args) {
        Object  a = null;
        //Object b = new Object();
        Object b = null;
        boolean aEqualsB = Objects.equal(a,b);
        System.out.println(aEqualsB);
    }
  /*
  public static boolean equal(@Nullable Object a, @Nullable Object b) {
        return a == b || (a != null && a.equals(b));
        首先判断是否相等，再判断是不是为null，
    }
    */

}
